<template>
  <div>
    <button @click="isShow = true">显示弹窗</button>
    <Teleport to="body">
      <div class="mask" v-show="isShow">这是弹窗</div>
    </Teleport>
  </div>
</template>

<script>
export default {
  name: "UserInfo",
  data() {
    return {
      isShow: false,
    };
  },
};
</script>

<style lang="scss" scoped>
.mask {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: #af3333;
}
</style>
